#!/usr/bin/env bash

icon() {
    # Lets round the float result
    bri=$(brightnessctl get)
    
    if [[ $bri -gt 90 ]]; then
        echo "󰃠"
        elif [[ $bri -gt 50 ]]; then
        echo "󰃝"
        elif [[ $bri -gt 30 ]]; then
        echo "󰃟"
    else
        echo "󰃞"
    fi
}

getbri() {
    bri=$(brightnessctl get)
    echo $bri
}

if [[ $1 == "--icon" ]]; then
    icon
    elif [[ $1 == "--value" ]]; then
    getbri
fi